Skip to content

5.0.1-beta-2#89

Open
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta-2
Open

5.0.1-beta-2#89
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta-2

Conversation

@rajnandan1
Copy link
Contributor

Raising PR to github

Copilot AI review requested due to automatic review settings January 16, 2026 12:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR converts Python model files to TypeScript interface definitions as part of version 5.0.1-beta-2. The changes replace Pydantic-based Python classes with TypeScript interfaces, transforming the codebase from Python to TypeScript for API model definitions.

Changes:

  • Converted Python model classes to TypeScript interfaces across multiple files
  • Replaced Python type annotations (StrictStr, StrictInt, etc.) with TypeScript types (str, int, float, bool)
  • Transformed Pydantic enum validators into TypeScript const enums with type definitions
  • Added new API initialization file for TypeScript exports

Reviewed changes

Copilot reviewed 133 out of 571 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
cashfree_pg/models/instrument_webhook_data_entity.py Converted Python Pydantic model to TypeScript interface
cashfree_pg/models/instrument_webhook_data.py Converted Python model to TypeScript with type annotations changed from Python to TypeScript syntax
cashfree_pg/models/instrument_entity.py Converted Python model with enum validators to TypeScript interface with const enum definitions
cashfree_pg/models/idempotency_error.py Converted Python model to TypeScript interface with enum type definition
cashfree_pg/models/disputes_entity_merchant_accepted.py Converted complex Python model with multiple enums to TypeScript interface
cashfree_pg/models/discount_details.py Converted Python model with enum validator to TypeScript interface with enum definition
cashfree_pg/api/init.py Added new TypeScript API initialization file with imports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +40
* @type {str}
* @memberof InstrumentWebhookData
*/
'event_time'?: str;
/**
*
* @type {str}
* @memberof InstrumentWebhookData
*/
'type'?: str;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript type annotations are using Python type names. In TypeScript, primitive types should be lowercase: 'string' instead of 'str', 'number' instead of 'int' or 'float', and 'boolean' instead of 'bool'. This pattern appears throughout all converted files and will cause TypeScript compilation errors.

Suggested change
* @type {str}
* @memberof InstrumentWebhookData
*/
'event_time'?: str;
/**
*
* @type {str}
* @memberof InstrumentWebhookData
*/
'type'?: str;
* @type {string}
* @memberof InstrumentWebhookData
*/
'event_time'?: string;
/**
*
* @type {string}
* @memberof InstrumentWebhookData
*/
'type'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +40
* @type {str}
* @memberof InstrumentWebhookData
*/
'event_time'?: str;
/**
*
* @type {str}
* @memberof InstrumentWebhookData
*/
'type'?: str;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript type annotations are using Python type names. In TypeScript, primitive types should be lowercase: 'string' instead of 'str', 'number' instead of 'int' or 'float', and 'boolean' instead of 'bool'. This pattern appears throughout all converted files and will cause TypeScript compilation errors.

Suggested change
* @type {str}
* @memberof InstrumentWebhookData
*/
'event_time'?: str;
/**
*
* @type {str}
* @memberof InstrumentWebhookData
*/
'type'?: str;
* @type {string}
* @memberof InstrumentWebhookData
*/
'event_time'?: string;
/**
*
* @type {string}
* @memberof InstrumentWebhookData
*/
'type'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +46
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: List[str];
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: List[str];
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: str;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: str;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript uses 'Array' or 'T[]' syntax for arrays, not Python's 'List[T]' syntax. These should be 'Array' or 'string[]' to be valid TypeScript.

Suggested change
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: List[str];
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: List[str];
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: str;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: str;
* @type {Array<string>}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: Array<string>;
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {Array<string>}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: Array<string>;
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {string}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: string;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {string}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +46
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: List[str];
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: List[str];
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: str;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: str;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript uses 'Array' or 'T[]' syntax for arrays, not Python's 'List[T]' syntax. These should be 'Array' or 'string[]' to be valid TypeScript.

Suggested change
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: List[str];
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: List[str];
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: str;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: str;
* @type {Array<string>}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: Array<string>;
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {Array<string>}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: Array<string>;
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {string}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: string;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {string}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +40
* @type {object}
* @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner
*/
'tags'?: object;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'object' type in TypeScript should be lowercase and typically 'Record<string, any>' or a specific interface would be more appropriate for better type safety.

Suggested change
* @type {object}
* @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner
*/
'tags'?: object;
* @type {Record<string, any>}
* @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner
*/
'tags'?: Record<string, any>;

Copilot uses AI. Check for mistakes.
'instrument_meta'?: SavedInstrumentMeta;
}

export const Instrument_typeEnum = {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript enum naming convention uses PascalCase, not snake_case. These should be renamed to 'InstrumentTypeEnum' for consistency with TypeScript best practices.

Copilot uses AI. Check for mistakes.
'unknown_default_open_api': 'unknown_default_open_api'
} as const;

export type Instrument_typeEnum = typeof Instrument_typeEnum[keyof typeof Instrument_typeEnum];
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript enum naming convention uses PascalCase, not snake_case. These should be renamed to 'InstrumentTypeEnum' for consistency with TypeScript best practices.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
# flake8: noqa

# import apis into api package
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file appears to contain Python-style imports in a TypeScript conversion PR. The file extension is .py but the content seems intended for TypeScript. Either the file extension should be .ts or the imports should use TypeScript syntax (import/export statements).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants